#coding=utf-8
from rest_framework import serializers
from rest_framework import viewsets

from worldcup.apps.userModel.models import User


class UserSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ('openid', 'wxname', 'gender', 'imgurl', 'age', 'wxid', 'description')
        lookup_field = 'openid'


class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer
    lookup_field = 'openid'

